/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package apus.exception;

import java.io.*;

/**
 * The <code>ErrorOutput</code> class represents error in writing file.
 * @author  Maxim Vasilevsky
 * @author  Roman Dyatkovsky
 * @since APUS v0.5
 */
public class ErrorOutput{
    
    private static final File errorLogFile = new File("./ErrorLog.txt");
    private static PrintWriter writer;
    
    static {
        try {
            writer = new PrintWriter(new BufferedWriter(new FileWriter(errorLogFile)));
        } catch (IOException ex) {
            //throw new BusinessException("Error while log file creating", ex);
            System.out.println("Logging to file won't work");
        }
    }
    
    public static void WriteError (String message){
        writer.println(message);
        writer.flush();
    }   
    
    public static void CloseErrorWriter () {
        writer.close();
    }

}
